<div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="<?=site_url()?>">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="<?=site_url('shops/index')?>">店铺管理</a><span class="crumb-step">&gt;</span><span>新增作品</span></div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
                <form action="<?=site_url('shops/update_oper')?>" method="post" id="myform" name="myform" enctype="multipart/form-data">
                    <table class="insert-tab" width="100%">
                        <tbody>
                            <tr>
                                <th width="120"><i class="require-red">*</i>商铺ID：</th>
                                <td>
                                    <input class="common-text required" id="title" name="shops_id" size="50" value="<?=$res['shops_id']?>" type="text" readonly="readonly" style="background-color:#f3f3f3">
                                    <a class="btn btn-primary btn2" href="javascript:getshops();">更新</a>
                                </td>
                            </tr>
                            <tr>
                                <th>金额：</th>
                                <td><input class="common-text" name="income" size="50" value="<?=$res['income']?>" type="text"></td>
                            </tr>
                            <tr>
                                <th>到期时间：</th>
                                <td><input class="common-text laydate-icon" name="end_time" size="48" value="<?=date('Y-m-d',$res['end_time'])?>" type="text" readonly="readonly" id="date_end"></td>
                            </tr>
                            <tr>
                                <th>商铺名称：</th>
                                <td><input class="common-text" name="name" size="50" value="<?=$res['name']?>" type="text" readonly="readonly" style="background-color:#f3f3f3"></td>
                            </tr>

                            <tr>
                                <th>连接地址：</th>
                                <td><input class="common-text" name="url" size="50" value="<?=$res['url']?>" type="text" readonly="readonly" style="background-color:#f3f3f3"></td>
                            </tr>

                            <tr>
                                <th>所属用户：</th>
                                <td><input class="common-text" name="uid" size="50" value="<?=$res['uid']?>" type="text" readonly="readonly" style="background-color:#f3f3f3"></td>
                            </tr>
                            
                            <tr>
                                <th></th>
                                <td>
                                    <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </form>
            </div>
        </div>
<script type="text/javascript" src="<?=base_url('public/lib/laydate/laydate.js')?>"></script>
<script type="text/javascript">

    function getshops(){
        var index = layer.load(0);
        //获取参数
        var sid = $('input[name=shops_id]').val();

        $.post("<?=site_url('shops/get_shops')?>",{sid:sid},function(res){
            //alert(res);
            //return false;
            if(typeof res.err == 'undefined'){
                //分配变量
                $('input[name=end_time]').val(res.uptime);
                $('input[name=name]').val(res.name);
                var url = 'http://zbzmall.com/shops/index/sid/'+res.id+'.html';
                $('input[name=url]').val(url);
                $('input[name=uid]').val(res.founder);
            }else{
                layer.alert(res.err,{
                    icon:2,
                });
            }
            layer.close(index); 
        },'json');
    }

    laydate({
        elem: '#date_end', //目标元素。由于laydate.
        min: laydate.now(), //设定最小日期为当前日期
    });

    $('#myform').submit(function() {
        var index = layer.load(0);
        $(this).ajaxSubmit(function(data){
            if(data == 1){
                 layer.alert('更新商铺成功！',{
                    icon:1,
                },function(){
                    location.href="<?=site_url('shops')?>";
                });
            }else{
                layer.alert(data,{
                    icon:2,
                });
            }
            layer.close(index); 
        })
        return false;
    })

</script>